Yes, you can. Immediately adding the extra up-velocity, adds it at once so the player will jump high very quickly. Both ways are equally valid, it depends on what you want.
Yes, you can. Immediately adding the extra up-velocity, adds it at once so the player will jump high very quickly. Both ways are equally valid, it depends on what you want.
Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.
Example:
Code://self being rabbit player local.addheight = 56; //amount the player will jump higher, in game units. local.add = local.addheight / 10; //increment while (self && IsAlive self && self.rabbit == 1) { if (self.velocity[2] > 50.0) { while (self.velocity[2] < (local.addHeight + 56.0)) { self.velocity = ( self.velocity[0] self.velocity[1] (self.velocity[2] + local.add) ) waitframe //i.e. 0.05 seconds, so this adds all additional height velocity in half a second, change if necessary. } } waitframe }
Last edited by Sor; November 16th, 2012 at 02:29 AM.
Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.
Thanks for the code sample Sor, but this didn't work for me. The rabbit just starts jumping uncontrollably. The rabbit is not even using his jump key. He just spawns and starts immediately jumping higher and bouncing until he's reached the top of the map and can go no further. Any idea why?
Browse MOHAA Servers Post GameSpy Era
VISIT MOHREBORN.COM FOR LATEST INFORMATION
Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!
Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
Add your Medal of Honor Server to the Master List
YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!
MOHAA Mods and UtilitiesOwN-3m-All's Mods
Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.
Quality Game Servers
Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.
Try adding longer 'wait's in there , so you need one after he spawns ( because when you spawn you start higher and come back down to the ground ) which gives the script the impression the rabbit it jumping
Also try adding a longer waitframe , so it gives the player time to get back to the ground before it checks to see if the player has jumped , since there is no wait , it keeps checking and makes the rabbit keep jumping higher
Try changing them till they suit your needs
I think
Now the above it just a guess as to where to put the waits , try and error :PCode://self being rabbit player local.addheight = 56; //amount the player will jump higher, in game units. local.add = local.addheight / 10; //increment while (self && IsAlive self && self.rabbit == 1) wait 2 // waits 2 seconds after spawn { if (self.velocity[2] > 50.0) { while (self.velocity[2] < (local.addHeight + 56.0)) { self.velocity = ( self.velocity[0] self.velocity[1] (self.velocity[2] + local.add) ) wait 2 // adjust this to give player enough time to land back on ground ///waitframe //i.e. 0.05 seconds, so this adds all additional height velocity in half a second, change if necessary. } } }
Purple's Playground
OBJ : 103.29.85.127:12203
xfire: purpleelephant1au
email: purpleelephant1au@gmail.com
skydrive: PurpleElephantSkydrive
I've tried different variants of this, but none work.
I keep getting this error to loop in my log though and the server eats up my cpu and memory:Code:while (level.rabbit != NULL && level.rabbit != NIL && isAlive(level.rabbit) && level.rabbit.dmteam != spectator) { // Jump Settings if(level.rabbit.jumpTo == NIL || level.rabbit.jumpTo == NULL){ if(int(getcvar(rJumpMode))){ local.jumpMode = int(getcvar(rJumpMode)) // Is jump mode enabled if(local.jumpMode == 1){ if(int(getcvar(rJumpHeight))){ level.jumpHeight = int(getcvar(rJumpHeight)) }else{ level.jumpHeight = 100 } level.rabbit.jumpTo = level.jumpHeight level.rabbit.velocity = ( level.rabbit.velocity[0] level.rabbit.velocity[1] (level.rabbit.velocity[2] + level.jumpHeight) ) } } } } level.rabbit.jumpTo == NIL
Also, the rabbit only initially jumps that high when spawned. Each time the rabbit player jumps after, his jump height is still the same. I only want the rabbit to jump higher when the rabbit presses his jump key.Code:CGM buffer for client 0 is full CGM buffer for client 1 is full CGM buffer for client 0 is full CGM buffer for client 1 is full
If I keep it in the while loop as posted by Sor, the rabbit just continues to jump up like a ladder for some reason. He jumps up, gets half way to the ground, jumps up again, gets half way from the old point of jumping, and so on.
I don't want to increase the wait time in that loop because it will mess up my seconds counter by adding more wait time than 1 second, so is it just a wait issue? How would I get it to not affect my time counter? Like this? But is this causing the CGM buffer overflows?
EDIT: HMM, I see you divide your jump variable by 10, so that you just increase it slightly until the rabbit reaches that height... you can't do what I'm doing because it happens all at once which causes the increasing height bunny hop?Code:thread rabbitJump while (level.rabbit != NULL && level.rabbit != NIL && isAlive(level.rabbit) && level.rabbit.dmteam != spectator) { // Jump Settings if(int(getcvar(rJumpMode))){ local.jumpMode = int(getcvar(rJumpMode)) // Is jump mode enabled if(local.jumpMode == 1){ if(int(getcvar(rJumpHeight))){ level.jumpHeight = int(getcvar(rJumpHeight)) }else{ level.jumpHeight = 100 } } } } rabbitJump: wait 5 while(1){ wait 2 while (level.rabbit != NULL && level.rabbit != NIL && isAlive(level.rabbit) && level.rabbit.dmteam != spectator && level.jumpHeight != NIL && level.jumpHeight != NULL && level.rabbit.velocity[2] < (level.jumpHeight + 56.0)) { level.rabbit.velocity = ( level.rabbit.velocity[0] level.rabbit.velocity[1] (level.rabbit.velocity[2] + level.jumpHeight) ) wait 2 //i.e. 0.05 seconds, so this adds all additional height velocity in half a second, change if necessary. } } end
Last edited by own3mall; November 19th, 2012 at 09:06 PM.
Browse MOHAA Servers Post GameSpy Era
VISIT MOHREBORN.COM FOR LATEST INFORMATION
Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!
Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
Add your Medal of Honor Server to the Master List
YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!
MOHAA Mods and UtilitiesOwN-3m-All's Mods
Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.
Quality Game Servers
Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.
Got it to work with this code:
Code:rabbitJump: wait 5 while(1){ waitframe while (level.rabbit != NULL && level.rabbit != NIL && isAlive(level.rabbit) && level.rabbit.dmteam != spectator && level.jumpHeight != NIL && level.jumpHeight != NULL && level.rabbit.velocity[2] < (level.jumpHeight + 56.0) && level.rabbit.velocity[2] > 0) { level.rabbit.velocity = ( level.rabbit.velocity[0] level.rabbit.velocity[1] (level.rabbit.velocity[2] + (level.jumpHeight / 10)) ) waitframe //i.e. 0.05 seconds, so this adds all additional height velocity in half a second, change if necessary. } waitframe } end
Browse MOHAA Servers Post GameSpy Era
VISIT MOHREBORN.COM FOR LATEST INFORMATION
Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!
Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
Add your Medal of Honor Server to the Master List
YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!
MOHAA Mods and UtilitiesOwN-3m-All's Mods
Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.
Quality Game Servers
Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.
Thats good , i knew it had to do with adding a wait somewhere in there lol
Im testing the new release in ffa mode tonight and ill get back to you on results , should be good tho :P
Good Job
Purple's Playground
OBJ : 103.29.85.127:12203
xfire: purpleelephant1au
email: purpleelephant1au@gmail.com
skydrive: PurpleElephantSkydrive
Sorry, didn't notice the new posts until now, but, yes, that'll work. I just wrote something, never tested if it worked. But I'd change your while() statement to this, though:
It removes the redundant checks.Code:while (level.rabbit && isAlive(level.rabbit) && level.rabbit.dmteam != spectator && level.jumpHeight != NIL && level.rabbit.velocity[2] < (level.jumpHeight + 56.0) && level.rabbit.velocity[2] > 0)
Either way, I'm glad it's workingand I hope you learned something new about scripting.
Last edited by Sor; November 20th, 2012 at 02:20 AM.
Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.